# SRS支持WebRTC，可以做会议或视频聊天
# 请将CANDIDATE设置为服务器的外网地址
export CANDIDATE="172.26.244.32"
docker run --rm --env CANDIDATE=$CANDIDATE \
    -p 1935:1935 -p 8080:8080 -p 1985:1985 -p 8000:8000/udp \
    registry.cn-hangzhou.aliyuncs.com/ossrs/srs:6 \
    objs/srs -c conf/rtc.conf

# 使用RTMP推流或播放: rtmp://localhost/live/livestream
# 使用HTTP-FLV播放流: http://localhost:8080/live/livestream.flv
# 使用HLS播放流: http://localhost:8080/live/livestream.m3u8
# WebRTC推流: http://localhost:1985/rtc/v1/whip/?app=live&stream=livestream
# WebRTC播放: http://localhost:1985/rtc/v1/whep/?app=live&stream=livestream

# WebRTC over TCP
# ==================================
# docker run --rm -it -p 8080:8080 -p 1985:1985 -p 8000:8000 \
#   -e CANDIDATE="192.168.3.82" \
#   -e SRS_RTC_SERVER_TCP_ENABLED=on \
#   -e SRS_RTC_SERVER_PROTOCOL=tcp \
#   -e SRS_RTC_SERVER_TCP_LISTEN=8000 \
#   registry.cn-hangzhou.aliyuncs.com/ossrs/srs:6

# video room
# ==================================

# export CANDIDATE="192.168.1.10"
# docker run --rm --env CANDIDATE=$CANDIDATE \
#     -p 1935:1935 -p 8080:8080 -p 1985:1985 -p 8000:8000/udp \
#     registry.cn-hangzhou.aliyuncs.com/ossrs/srs:5 \
#     objs/srs -c conf/rtc.conf

# 本机启动信令
# docker run --rm -p 1989:1989 registry.cn-hangzhou.aliyuncs.com/ossrs/signaling:1

# 启动httpx-static，转换HTTPS和WSS协议：

# docker run --rm -p 80:80 -p 443:443 registry.cn-hangzhou.aliyuncs.com/ossrs/httpx:1 \
#     ./bin/httpx-static -http 80 -https 443 -ssk ./etc/server.key -ssc ./etc/server.crt \
#     -proxy http://$CANDIDATE:1989/sig -proxy http://$CANDIDATE:1985/rtc \
#     -proxy http://$CANDIDATE:8080/

# Room to Live
# ==================================
# export CANDIDATE="192.168.1.10"
# docker run --rm --env CANDIDATE=$CANDIDATE \
#     -p 1935:1935 -p 8080:8080 -p 1985:1985 -p 8000:8000/udp \
#     registry.cn-hangzhou.aliyuncs.com/ossrs/srs:6 \
#     objs/srs -c conf/rtc2rtmp.conf
